const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  //配置babel-loader忽略所有node_modules 中的文件(提高打包速度)
  transpileDependencies: false,
  //服务器配置
  devServer: {
    //主机地址
    host: "localhost",
    // host: "127.0.0.1",
    // host: "192.168.17.101",
    port: "8080",
    open: true, //自动打开浏览器
    //配置正向代理
    proxy: {
      "/dev-api1": {
        target: "http://gmall-h5-api.atguigu.cn/",
        changeOrigin: true,
        pathRewrite: {
          "^/dev-api1": "",
        },
      },
    },
  },
  //开启或者关闭项目的eslint检查(不推荐)
  //lintOnSave: false

  //配置路径别名
  //如果这个值是一个对象,则会通过webpack-merge合并到最终的配置中
  configureWebpack: {
    resolve: {
      alias: {
        "@assets": "@/assets",
        "@comp": "@/components",
        "@pages": "@/pages",
      },
    },
  },
});
